#ifndef TEACHER_INFORMATION_DIALOG_H
#define TEACHER_INFORMATION_DIALOG_H

#include <QDialog>

namespace Ui {
class TeacherInformationDialog;
}

class TeacherInformationDialog : public QDialog
{
    Q_OBJECT

public:
    explicit TeacherInformationDialog(QWidget *parent = nullptr);
    ~TeacherInformationDialog();

private:
    Ui::TeacherInformationDialog *ui;

private:

    enum DialogStatus{
        AlterInformation = 0,
        InsertInformation = 1,
    };
    //记录原始学生id
    QString m_originalTeacherId;
    //记录原始密码
    QString m_originalPassword;
    //界面状态
    int m_dialogStatus = 0;

private:
    /**
     * @brief 初始化界面样式
     */
    void initializeSetStyleSheet();
    /**
     * @brief 新增教师信息到数据库
     * @return
     */
    bool insertTeacherInformation2Database();
    /**
     * @brief 更新教师信息到数据库
     * @return
     */
    bool updateTeacherInformation2Database();


public slots:
    /**
     * @brief 初始化修改界面数据
     */
    void initializeAlterTeacherInformationDialog(QString id);
    /**
     * @brief 初始化新增信息界面数据
     */
    void initializeInsertTeacherInformationDialog();

signals:
    /**
     * @brief 跳转到主界面
     */
    void teacherInformationDialog2MainInterface();
};

#endif // TEACHER_INFORMATION_DIALOG_H
